﻿@using Abp.Web.Mvc.Extensions
@using MyCompanyName.AbpZeroTemplate.Web.Navigation
@model MyCompanyName.AbpZeroTemplate.Web.Areas.Mpa.Models.Languages.LanguageTextsViewModel
@{
    ViewBag.CurrentPageName = PageNames.App.Common.Languages;
}
@section Styles
{
    @Html.IncludeStyle("~/Areas/Mpa/Views/Languages/Texts.min.css")
}
@section Scripts
{
    @Html.IncludeScript("~/Areas/Mpa/Views/Languages/_EditTextModal.js")
    @Html.IncludeScript("~/Areas/Mpa/Views/Languages/Texts.js")
}
<div class="row margin-bottom-5">
    <div class="col-xs-6">
        <div class="page-head">
            <div class="page-title">
                <h1>
                    <span>@L("LanguageTexts")</span> <small>@L("LanguageTextsHeaderInfo")</small>
                </h1>
            </div>
        </div>
    </div>
    <div class="col-xs-6 text-right">

    </div>
</div>

<div class="portlet light">
    <div class="portlet-title portlet-title-filter">
        <div class="inputs inputs-full-width">
            <div class="portlet-input">
                <form id="TextsFilterForm">
                    <div class="row">
                        <div class="col-sm-6 col-md-3">
                            <div class="form-group">
                                <label for="TextBaseLanguageSelectionCombobox">@L("BaseLanguage")</label>
                                <select id="TextBaseLanguageSelectionCombobox"
                                        class="form-control bs-select"
                                        data-live-search="true">
                                    @foreach (var language in Model.Languages)
                                    {
                                        <option data-icon="@language.Icon" value="@language.Name" @(language.Name == Model.BaseLanguageName ? "selected=\"selected\"" : "")>
                                            <i class="@language.Icon"></i>@language.DisplayName
                                        </option>
                                    }
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-6 col-md-3">
                            <div class="form-group">
                                <label for="TextTargetLanguageSelectionCombobox">@L("TargetLanguage")</label>
                                <select id="TextTargetLanguageSelectionCombobox"
                                        class="form-control bs-select"
                                        data-live-search="true">
                                    @foreach (var language in Model.Languages)
                                    {
                                        <option data-icon="@language.Icon" value="@language.Name" @(language.Name == Model.LanguageName ? "selected=\"selected\"" : "")>
                                            <i class="@language.Icon"></i>@language.DisplayName
                                        </option>
                                    }
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-6 col-md-3">
                            <div class="form-group">
                                <label for="TextSourceSelectionCombobox">@L("Source")</label>
                                @Html.DropDownList(
                                    "SourceName",
                                    Model.Sources,
                                    new
                                    {
                                        @class = "form-control selectpicker",
                                        data_live_search = "true",
                                        id = "TextSourceSelectionCombobox"
                                    })
                            </div>
                        </div>
                        <div class="col-sm-6 col-md-3">
                            <div class="form-group">
                                <label for="TargetValueFilterSelectionCombobox">@L("TargetValue")</label>
                                <select id="TargetValueFilterSelectionCombobox" class="form-control bs-select">
                                    <option value="ALL" @(Model.TargetValueFilter == "ALL" ? "selected=\"selected\"" : "")>@L("All")</option>
                                    <option value="EMPTY" @(Model.TargetValueFilter == "EMPTY" ? "selected=\"selected\"" : "")>@L("EmptyOnes")</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="input-group">
                        <input id="TextFilter" value="@Model.FilterText" class="form-control" placeholder="@L("SearchWithThreeDot")" type="text">
                        <span class="input-group-btn">
                            <button id="RefreshTextsButton" class="btn default" type="submit"><i class="icon-refresh"></i> @L("Refresh")</button>
                        </span>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div class="portlet-body">
        <div id="TextsTable"></div>
    </div>
</div>